package pers.xiaojun.boot.module.system.dao.entity.oauth2;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.*;
import lombok.experimental.Accessors;
import pers.xiaojun.boot.mybatis.core.enitiy.BaseEntity;
import pers.xiaojun.boot.tenant.core.db.TenantBaseEntity;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 刷新令牌实体
 *
 * @author xiaojun
 * @since 2025-10-16
 */
@TableName(value = "system_oauth2_refresh_token", autoResultMap = true)
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class OAuth2RefreshTokenDO extends TenantBaseEntity {

    /**
     * 编号，数据库字典
     */
    private Long id;
    /**
     * 刷新令牌
     */
    private String refreshToken;
    /**
     * 用户编号
     */
    private Long userId;
    /**
     * 用户类型
     */
    private Integer userType;
    /**
     * 客户端编号
     */
    private String clientId;
    /**
     * 授权范围
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> scopes;
    /**
     * 过期时间
     */
    private LocalDateTime expiresTime;

}
